Currently, there are generally two manners for charging an electronic device: one manner is charging the electronic device by connecting the electronic device to a dedicated charger (for example, a mobile phone charger) of the electronic device; the other manner is charging the electronic device by connecting the electronic device to a Universal Serial Bus (USB) host device (for example, a personal computer (PC)) by using a USB interface. Because host devices having a USB interface are widely used, the charging manner of using a USB host device is widely applied because this charging manner is convenient.
In the prior art, when the electronic device is inserted into the USB host device by using the USB interface, the electronic device determines a USB supply current according to whether a communication handshake with the USB host device is successful. If the communication handshake with the USB host device fails, the USB charging current is limited below 100 milliampere (mA). If the communication handshake with the USB host device is successful, the USB charging current is limited below 500 mA.
However, because a charging current when charging is performed by using the USB interface is generally limited within 500 mA, a charging speed is relatively low. Especially, if the battery of an electronic device is depleted or the battery is extremely low, charging by using the USB cannot support a user to perform a power-consuming operation such as making a call or playing a game. To simply improve a charging current causes a device to be restarted repeatedly due to an insufficient charging voltage because the charging current becomes excessively high. In addition, the excessively high charging current further causes a device board to heat. Continuous heat of the device board further causes lines on the board to expand with heat and be broken and damages the board, and may even cause a fire safety accident. Therefore, implementing fast charging of an electronic device while ensuring that the device is safe is an urgent problem that needs to be resolved.